package com.car.shopping.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.car.shopping.controller.form.AddGoodsInfoForm;
import com.car.shopping.controller.form.FindGoodsForPageForm;
import com.car.shopping.entity.GoodsInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.car.shopping.service.dto.AddGoodsInfoDto;
import com.car.shopping.service.dto.GoodsDto;
import com.car.shopping.service.dto.GoodsInfoDto;
import com.car.shopping.service.param.AddGoodsInfoParam;
import com.car.shopping.service.param.ModifyGoodsInfoParam;

import java.util.List;
import java.util.Set;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 董旭
 * @since 2024-08-28
 */
public interface GoodsInfoService extends IService<GoodsInfo> {



    public List<GoodsInfoDto> findGoodsInfoListByIds(Set<Integer> ids);

    public void updateGoodsStock(Set<GoodsDto> goods);

    public AddGoodsInfoForm addGoods(AddGoodsInfoParam addGoodsInfoParam, Integer adminId)throws Exception;

    public Page<GoodsInfo> findGoodsForPage(FindGoodsForPageForm form);

    public void modifyGoods(ModifyGoodsInfoParam modifyGoodsInfoParam, Integer adminId);

    public void addStock(Set<GoodsDto> goods);

    public void addStockAndReduceFreezeStock(Set<GoodsDto> goods);

    public void reduceFreezeStock(Set<GoodsDto> goods);

    public void reduceStock(Set<GoodsDto> goodsDtos);

    public List<GoodsInfo> findAll()throws Exception;

    public GoodsInfo findGoodsById(Integer id)throws Exception;

    public void state(Integer goodsId)throws Exception;
}
